//
//  XMUserDetailBottomView.m
//  XunMi
//
//  Created by MacBook on 2024/2/20.
//  Copyright © 2024 TieZhu. All rights reserved.
//

#import "XMUserDetailBottomView.h"

@interface XMUserDetailBottomView ()
@property (weak, nonatomic) IBOutlet UIButton *hiButton;
@property (weak, nonatomic) IBOutlet UILabel *forkLa;
@property (weak, nonatomic) IBOutlet UIImageView *forkImgV;

@end

@implementation XMUserDetailBottomView

- (void)awakeFromNib {
    [super awakeFromNib];
    
//    [_fockButton setImage:kGetImage(@"user_d_fork_n") forState:UIControlStateNormal];
//    [_fockButton setImage:kGetImage(@"user_d_fork_s") forState:UIControlStateSelected];
//
//    [_fockButton setTitle:@"关注" forState:UIControlStateNormal];
//    [_fockButton setTitle:@"已关注" forState:UIControlStateSelected];
//
//    [_fockButton setTitleColor:k8C8F9D forState:UIControlStateNormal];
//    [_fockButton setTitleColor:kAppMainColor forState:UIControlStateSelected];
    [_hiButton setImagePosition:(XMImagePositionLeft) spacing:14];
}

- (void)setModel:(XMUserModel *)model {
    _model = model;
    if (model.is_regard) {
        self.forkImgV.image = kGetImage(@"user_d_fork_s");
        self.forkLa.text = @"已关注";
        self.forkLa.textColor = kAppMainColor;
    } else {
        self.forkImgV.image = kGetImage(@"user_d_fork_n");
        self.forkLa.text = @"关注";
        self.forkLa.textColor = kHEX(@"8C8F9D");
    }
}

- (IBAction)hiAction:(UIButton *)sender {
    if (self.chatBlock) {
        self.chatBlock(self.model, sender);
    }
}

- (IBAction)forkAction:(UIButton *)sender {
    if (self.followBlock) {
        self.followBlock(self.model, sender);
    }
}

@end
